// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod confidential_computing {
    use crate::Result;

    /// A builder for [ConfidentialComputing][crate::client::ConfidentialComputing].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_confidentialcomputing_v1::*;
    /// # use builder::confidential_computing::ClientBuilder;
    /// # use client::ConfidentialComputing;
    /// let builder : ClientBuilder = ConfidentialComputing::builder();
    /// let client = builder
    ///     .with_endpoint("https://confidentialcomputing.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::ConfidentialComputing;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = ConfidentialComputing;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::ConfidentialComputing] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [ConfidentialComputing::create_challenge][crate::client::ConfidentialComputing::create_challenge] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_confidentialcomputing_v1::builder;
    /// use builder::confidential_computing::CreateChallenge;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateChallenge {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateChallenge(RequestBuilder<crate::model::CreateChallengeRequest>);

    impl CreateChallenge {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateChallengeRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Challenge> {
            (*self.0.stub)
                .create_challenge(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateChallengeRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [challenge][crate::model::CreateChallengeRequest::challenge].
        ///
        /// This is a **required** field for requests.
        pub fn set_challenge<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Challenge>,
        {
            self.0.request.challenge = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [challenge][crate::model::CreateChallengeRequest::challenge].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_challenge<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Challenge>,
        {
            self.0.request.challenge = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateChallenge {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ConfidentialComputing::verify_attestation][crate::client::ConfidentialComputing::verify_attestation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_confidentialcomputing_v1::builder;
    /// use builder::confidential_computing::VerifyAttestation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> VerifyAttestation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct VerifyAttestation(RequestBuilder<crate::model::VerifyAttestationRequest>);

    impl VerifyAttestation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::VerifyAttestationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::VerifyAttestationResponse> {
            (*self.0.stub)
                .verify_attestation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [challenge][crate::model::VerifyAttestationRequest::challenge].
        ///
        /// This is a **required** field for requests.
        pub fn set_challenge<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.challenge = v.into();
            self
        }

        /// Sets the value of [gcp_credentials][crate::model::VerifyAttestationRequest::gcp_credentials].
        pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::GcpCredentials>,
        {
            self.0.request.gcp_credentials = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [gcp_credentials][crate::model::VerifyAttestationRequest::gcp_credentials].
        pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::GcpCredentials>,
        {
            self.0.request.gcp_credentials = v.map(|x| x.into());
            self
        }

        /// Sets the value of [tpm_attestation][crate::model::VerifyAttestationRequest::tpm_attestation].
        ///
        /// This is a **required** field for requests.
        pub fn set_tpm_attestation<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::TpmAttestation>,
        {
            self.0.request.tpm_attestation = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [tpm_attestation][crate::model::VerifyAttestationRequest::tpm_attestation].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_tpm_attestation<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::TpmAttestation>,
        {
            self.0.request.tpm_attestation = v.map(|x| x.into());
            self
        }

        /// Sets the value of [confidential_space_info][crate::model::VerifyAttestationRequest::confidential_space_info].
        pub fn set_confidential_space_info<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
        {
            self.0.request.confidential_space_info = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [confidential_space_info][crate::model::VerifyAttestationRequest::confidential_space_info].
        pub fn set_or_clear_confidential_space_info<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::ConfidentialSpaceInfo>,
        {
            self.0.request.confidential_space_info = v.map(|x| x.into());
            self
        }

        /// Sets the value of [token_options][crate::model::VerifyAttestationRequest::token_options].
        pub fn set_token_options<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::TokenOptions>,
        {
            self.0.request.token_options = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [token_options][crate::model::VerifyAttestationRequest::token_options].
        pub fn set_or_clear_token_options<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::TokenOptions>,
        {
            self.0.request.token_options = v.map(|x| x.into());
            self
        }

        /// Sets the value of [attester][crate::model::VerifyAttestationRequest::attester].
        pub fn set_attester<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.attester = v.into();
            self
        }

        /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation].
        ///
        /// Note that all the setters affecting `tee_attestation` are
        /// mutually exclusive.
        pub fn set_tee_attestation<
            T: Into<Option<crate::model::verify_attestation_request::TeeAttestation>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.tee_attestation = v.into();
            self
        }

        /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
        /// to hold a `TdCcel`.
        ///
        /// Note that all the setters affecting `tee_attestation` are
        /// mutually exclusive.
        pub fn set_td_ccel<
            T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_td_ccel(v);
            self
        }

        /// Sets the value of [tee_attestation][crate::model::VerifyAttestationRequest::tee_attestation]
        /// to hold a `SevSnpAttestation`.
        ///
        /// Note that all the setters affecting `tee_attestation` are
        /// mutually exclusive.
        pub fn set_sev_snp_attestation<
            T: std::convert::Into<std::boxed::Box<crate::model::SevSnpAttestation>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_sev_snp_attestation(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for VerifyAttestation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ConfidentialComputing::verify_confidential_space][crate::client::ConfidentialComputing::verify_confidential_space] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_confidentialcomputing_v1::builder;
    /// use builder::confidential_computing::VerifyConfidentialSpace;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> VerifyConfidentialSpace {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct VerifyConfidentialSpace(
        RequestBuilder<crate::model::VerifyConfidentialSpaceRequest>,
    );

    impl VerifyConfidentialSpace {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::VerifyConfidentialSpaceRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::VerifyConfidentialSpaceResponse> {
            (*self.0.stub)
                .verify_confidential_space(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [challenge][crate::model::VerifyConfidentialSpaceRequest::challenge].
        ///
        /// This is a **required** field for requests.
        pub fn set_challenge<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.challenge = v.into();
            self
        }

        /// Sets the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
        pub fn set_gcp_credentials<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::GcpCredentials>,
        {
            self.0.request.gcp_credentials = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [gcp_credentials][crate::model::VerifyConfidentialSpaceRequest::gcp_credentials].
        pub fn set_or_clear_gcp_credentials<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::GcpCredentials>,
        {
            self.0.request.gcp_credentials = v.map(|x| x.into());
            self
        }

        /// Sets the value of [signed_entities][crate::model::VerifyConfidentialSpaceRequest::signed_entities].
        pub fn set_signed_entities<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::SignedEntity>,
        {
            use std::iter::Iterator;
            self.0.request.signed_entities = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
        pub fn set_gce_shielded_identity<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::GceShieldedIdentity>,
        {
            self.0.request.gce_shielded_identity = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [gce_shielded_identity][crate::model::VerifyConfidentialSpaceRequest::gce_shielded_identity].
        pub fn set_or_clear_gce_shielded_identity<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::GceShieldedIdentity>,
        {
            self.0.request.gce_shielded_identity = v.map(|x| x.into());
            self
        }

        /// Sets the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
        pub fn set_options<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<
                    crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
                >,
        {
            self.0.request.options = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [options][crate::model::VerifyConfidentialSpaceRequest::options].
        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<
                    crate::model::verify_confidential_space_request::ConfidentialSpaceOptions,
                >,
        {
            self.0.request.options = v.map(|x| x.into());
            self
        }

        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation].
        ///
        /// Note that all the setters affecting `tee_attestation` are
        /// mutually exclusive.
        pub fn set_tee_attestation<
            T: Into<Option<crate::model::verify_confidential_space_request::TeeAttestation>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.tee_attestation = v.into();
            self
        }

        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
        /// to hold a `TdCcel`.
        ///
        /// Note that all the setters affecting `tee_attestation` are
        /// mutually exclusive.
        pub fn set_td_ccel<
            T: std::convert::Into<std::boxed::Box<crate::model::TdxCcelAttestation>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_td_ccel(v);
            self
        }

        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialSpaceRequest::tee_attestation]
        /// to hold a `TpmAttestation`.
        ///
        /// Note that all the setters affecting `tee_attestation` are
        /// mutually exclusive.
        pub fn set_tpm_attestation<
            T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_tpm_attestation(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for VerifyConfidentialSpace {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ConfidentialComputing::verify_confidential_gke][crate::client::ConfidentialComputing::verify_confidential_gke] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_confidentialcomputing_v1::builder;
    /// use builder::confidential_computing::VerifyConfidentialGke;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> VerifyConfidentialGke {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct VerifyConfidentialGke(RequestBuilder<crate::model::VerifyConfidentialGkeRequest>);

    impl VerifyConfidentialGke {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::VerifyConfidentialGkeRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::VerifyConfidentialGkeResponse> {
            (*self.0.stub)
                .verify_confidential_gke(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [challenge][crate::model::VerifyConfidentialGkeRequest::challenge].
        ///
        /// This is a **required** field for requests.
        pub fn set_challenge<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.challenge = v.into();
            self
        }

        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation].
        ///
        /// Note that all the setters affecting `tee_attestation` are
        /// mutually exclusive.
        pub fn set_tee_attestation<
            T: Into<Option<crate::model::verify_confidential_gke_request::TeeAttestation>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.tee_attestation = v.into();
            self
        }

        /// Sets the value of [tee_attestation][crate::model::VerifyConfidentialGkeRequest::tee_attestation]
        /// to hold a `TpmAttestation`.
        ///
        /// Note that all the setters affecting `tee_attestation` are
        /// mutually exclusive.
        pub fn set_tpm_attestation<
            T: std::convert::Into<std::boxed::Box<crate::model::TpmAttestation>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_tpm_attestation(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for VerifyConfidentialGke {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ConfidentialComputing::list_locations][crate::client::ConfidentialComputing::list_locations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_confidentialcomputing_v1::builder;
    /// use builder::confidential_computing::ListLocations;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListLocations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);

    impl ListLocations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
            (*self.0.stub)
                .list_locations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [name][location::model::ListLocationsRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListLocations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [ConfidentialComputing::get_location][crate::client::ConfidentialComputing::get_location] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_confidentialcomputing_v1::builder;
    /// use builder::confidential_computing::GetLocation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetLocation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);

    impl GetLocation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfidentialComputing>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<location::model::Location> {
            (*self.0.stub)
                .get_location(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][location::model::GetLocationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetLocation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
